<template>
    <page>
        <roll class="white-bg absfit">
            <div class="header bg8 white px16" flex="dir:top main:center">
                <p class="f20" flex="main:justify">{{code}}<span class="f14 c2" v-back="'petCard'">切换IC卡</span></p>
                <p class="f14 mt10 c9">{{shopName}}</p>
            </div>
            <m-header3 class="bg-main1" title="余额"><span class="c7">￥{{cardje}}元</span></m-header3>
            <m-loading :show="loading" class="white-bg wrap-loading"></m-loading>
            <div flex="cross:center" class="mx12 py12 bdb" v-for="i in list">
                <div flex-box="1">
                    <p class="f16">{{i.storno| storno}}</p>
                    <p class="f14 text3 mt12">{{i.cdatetime | dateFormat}}</p>
                </div>
                <span class="f16">{{i.cje | plusOrminus}}元</span>
            </div>
        </roll>
    </page>
</template>
<script>
  import urljoin from 'url-join'
  const storno = {
    'N': '新卡',
    'A': '直接修改',
    'C': '充值',
    'Z': '转存',
    'T': '退款',
    'L': '锁定',
    'U': '解锁',
    'Y': '预挂失',
    'R': '解除预挂失',
    'O': '挂失',
    'H': '换新卡',
    'J': '旧换新',
    'Q': '前台解锁',
    'E': '前台充值',
    'B': '前台支付读卡',
    'P': '前台支付',
    'D': '前台撤单',
    'M': '油机支付'
  }
  export default {
    filters: {
      storno (v) {
        return storno[v]
      }
    },
    data () {
      const {cardje, code, id, shopName, clientUrl} = this.$route.params
      return {
        shopName,
        code,
        cardje,
        id,
        clientUrl,
        list: [],
        form: {},
        loading: true
      }
    },
    computed: {},
    created () {
      this.getList()
    },
    methods: {
      PitsPullData () {},
      PitsPushData () {},
      async getList () {
        this.loading = true
        let {obj} = await this.$get(urljoin(this.clientUrl, '/card/getICCardMoneyByCard'), {
          cardCode: this.code
        })
        this.list = obj || []
        this.loading = false
      }
    },
    components: {}
  }
</script>
<style type="text/scss" lang="scss" scoped>
    .header {
        height: 100px;
        background-color: #3c435a;
    }
    .wrap-loading {
        position: absolute;
        top: 144px;
        right: 0;
        bottom: 0;
        left: 0;
    }
</style>
